package networking.messages.weaponMessages;

import com.jme.math.Vector3f;

import networking.messages.SimpleMessage;

public class WeaponFireAddMessage extends SimpleMessage {
	
	private int weaponID, weaponFireID, weaponFireClientID;
	private float dirX, dirY, dirZ;
	private long localTime;
	
	public WeaponFireAddMessage() {
		super();
	}
	
	public WeaponFireAddMessage(int weaponID, Vector3f dir, int weaponFireClientID) {
		this(weaponID, -1, dir);
		this.weaponFireClientID = weaponFireClientID;
	}
	
	public WeaponFireAddMessage(int weaponID, int weaponFireID, Vector3f dir) {
		this();
		this.weaponID = weaponID;
		this.weaponFireID = weaponFireID;
		
		dirX = dir.x;
		dirY = dir.y;
		dirZ = dir.z;
		
		localTime = System.currentTimeMillis();
	}
	
	public float getDirX() { return dirX; }
	
	public float getDirY() { return dirY; }
	
	public float getDirZ() { return dirZ; }
	
	public int getWeaponID() { return weaponID; }
	
	public int getWeaponFireID() { return weaponFireID; }
	
	public Vector3f getDirection() { return new Vector3f(dirX, dirY, dirZ); }
	
	public int getWeaponFireClientID() { return weaponFireClientID; }
	
	public void setupClient(int weaponFireClientID) {
		this.weaponFireClientID = weaponFireClientID;
	}
	
	public long getLocalTime() { return localTime; }
}